//
//  OwnerBuyNotesViewController.m
//  GoodWayClient
//
//  Created by newhuidong on 16/1/4.
//  Copyright © 2016年 HuiDong. All rights reserved.
//

#import "OwnerBuyNotesViewController.h"
#import "NotesBuyTableViewCell.h"

@interface OwnerBuyNotesViewController ()
@property(nonatomic,strong)NSArray * array;
@property(nonatomic,strong)NSMutableArray * mutableArray;

@property (strong, nonatomic) IBOutlet UITableView *buyNotesTableView;

@end

@implementation OwnerBuyNotesViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"购买记录";

    self.buyNotesTableView.tableHeaderView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 0.1)];

}
-(NSArray *)array{
    
    if (!_array) {
        
        _array=@[@{@"name":@""},@{@"name":@"地址：",@"event":@"珠江路新世界中心B座3912室",},@{@"name":@"时间",@"event":@"2015-12-31 23:59",@"time":@"交易成功"}];
    }
    return _array;
}
-(NSMutableArray *)mutableArray{
    
    if (!_mutableArray) {
        
        _mutableArray=[NSMutableArray arrayWithArray:self.array];
    }
    
    return _mutableArray;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    
    return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 3;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NotesBuyTableViewCell*cell=[NotesBuyTableViewCell NotesBuyWithTableView:self.buyNotesTableView];
    cell.dic=self.mutableArray[indexPath.row];
    NSLog(@"%@",self.mutableArray);
    
    switch (indexPath.row) {
        case 0:{
            UIImageView * imageView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"mall_title_img"]];
            imageView.frame=CGRectMake(5, 5, 5, 20);

            [cell addSubview:imageView];
            cell.textLabel.text=@"购买除碳服务";

        }
            break;
            
        default:
            break;
    }
    
    
    
    return cell;
}


@end
